package dk.itu.samd.group2.tagapastry.messages.forwardStrategies;

import java.util.Vector;

import dk.itu.samd.group2.tagapastry.IndexRelative;
import dk.itu.samd.group2.tagapastry.TagapastryImpl;
import dk.itu.samd.group2.tagapastry.messages.IndexMsg;
import dk.itu.samd.group2.tagapastry.messages.TagapastryMsg;

public class MulticastReturnToOriginatorForwardStrategy implements ForwardStrategy {

	@Override
	public void forward(Vector<IndexRelative> children, TagapastryImpl tagaImpl, IndexMsg msg) {
		for (IndexRelative child : children) {
			IndexMsg msgForChild = msg.cloneForChild(child);
			child.bufferOrForward(msgForChild, tagaImpl);
		}
	}

}
